package com.xxl.job.executor.service.jobhandler;


import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.log.XxlJobLogger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


/**
 * @Author: sijunqiang
 * @Date: 2020/6/10 15:29
 * @Description: 自定义xxl-job
 */


@Component
public class XxlJob extends IJobHandler {

    private static Logger logger = LoggerFactory.getLogger(XxlJob.class);




 @Autowired
 private TestFeign testFeign;



    @com.xxl.job.core.handler.annotation.XxlJob(value = "test-job")
    @Override
    public ReturnT<String> execute(String param) throws Exception {
        logger.info("param:[{}]", param);
        XxlJobLogger.log("XXL-JOB param:" + param);
        testFeign.doGet(param);
        return ReturnT.SUCCESS;
    }




}
